import 'package:json_annotation/json_annotation.dart';

part 'home_popular_model.g.dart';

@JsonSerializable()
class HomePopularModel {
  final List<TopList>? topList;
  final List<Popular>? popular;

  const HomePopularModel({
    this.topList,
    this.popular,
  });

  factory HomePopularModel.fromJson(Map<String, dynamic> json) =>
      _$HomePopularModelFromJson(json);

  Map<String, dynamic> toJson() => _$HomePopularModelToJson(this);
}

@JsonSerializable()
class TopList {
  final String? roomNo;
  final String? roomCode;
  final String? roomName;
  final String? roomIcon;
  final int? roomCategoryId;
  final String? roomCategoryName;
  final String? roomCategoryColor;
  final String? categoryTypeIcon;
  final String? backgroundUrl;
  final int? scoreWeight;
  final List<dynamic>? roomInfoTagList;
  final bool? isActivate;
  final bool? isLock;
  final int? hostUserId;
  final int? pkType;
  final int? roomStatus;
  final String? bgImg;
  final String? country;
  final String? countryUrl;
  final String? slogan;
  final bool? isShow;
  final String? rightTopIcon;
  final int? realPeople;
  final String? playImg;
  final String? secondCategoryImg;
  final String? secondPlayImg;
  final int? maleCount;
  final int? ladyCount;
  final String? freeShow;
  final String? hotRoomIcon;
  final int? roomTemplateId;

  // 根据此字段判断是否需要带type
  final String? rangeTypeStr;

  const TopList({
    this.roomNo,
    this.roomCode,
    this.roomName,
    this.roomIcon,
    this.roomCategoryId,
    this.roomCategoryName,
    this.roomCategoryColor,
    this.categoryTypeIcon,
    this.backgroundUrl,
    this.scoreWeight,
    this.roomInfoTagList,
    this.isActivate,
    this.isLock,
    this.hostUserId,
    this.pkType,
    this.roomStatus,
    this.bgImg,
    this.country,
    this.countryUrl,
    this.slogan,
    this.isShow,
    this.rightTopIcon,
    this.realPeople,
    this.playImg,
    this.secondCategoryImg,
    this.secondPlayImg,
    this.maleCount,
    this.ladyCount,
    this.freeShow,
    this.hotRoomIcon,
    this.roomTemplateId,
    this.rangeTypeStr,
  });

  factory TopList.fromJson(Map<String, dynamic> json) =>
      _$TopListFromJson(json);

  Map<String, dynamic> toJson() => _$TopListToJson(this);
}

@JsonSerializable()
class Popular {
  final String? roomNo;
  final String? roomCode;
  final String? roomName;
  final String? roomIcon;
  final int? roomCategoryId;
  final String? roomCategoryName;
  final String? roomCategoryColor;
  final String? categoryTypeIcon;
  final String? backgroundUrl;
  final int? scoreWeight;
  final List<dynamic>? roomInfoTagList;
  final bool? isActivate;
  final bool? isLock;
  final int? hostUserId;
  final int? pkType;
  final int? roomStatus;
  final String? bgImg;
  final String? country;
  final String? countryUrl;
  final String? slogan;
  final bool? isShow;
  final String? rightTopIcon;
  final int? realPeople;
  final String? playImg;
  final String? secondCategoryImg;
  final String? secondPlayImg;
  final int? maleCount;
  final int? ladyCount;
  final String? freeShow;
  final String? hotRoomIcon;
  final int? roomTemplateId;
  // 根据此字段判断是否需要带type
  final String? rangeTypeStr;

  const Popular({
    this.roomNo,
    this.roomCode,
    this.roomName,
    this.roomIcon,
    this.roomCategoryId,
    this.roomCategoryName,
    this.roomCategoryColor,
    this.categoryTypeIcon,
    this.backgroundUrl,
    this.scoreWeight,
    this.roomInfoTagList,
    this.isActivate,
    this.isLock,
    this.hostUserId,
    this.pkType,
    this.roomStatus,
    this.bgImg,
    this.country,
    this.countryUrl,
    this.slogan,
    this.isShow,
    this.rightTopIcon,
    this.realPeople,
    this.playImg,
    this.secondCategoryImg,
    this.secondPlayImg,
    this.maleCount,
    this.ladyCount,
    this.freeShow,
    this.hotRoomIcon,
    this.roomTemplateId,
    this.rangeTypeStr
  });

  factory Popular.fromJson(Map<String, dynamic> json) =>
      _$PopularFromJson(json);

  Map<String, dynamic> toJson() => _$PopularToJson(this);
}
